package ru.averta.notes.domain;

import java.util.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ru.averta.notes.domain.abstr.AbstractPersistentObject;
import ru.averta.notes.domain.abstr.UserableObject;

@Entity
@Table(name = "Tag")
public class Tag extends UserableObject {

	@Column(name = "TITLE")
	private String title;
	
	@Column(name = "COUNT")
	private int count;
	
	public Tag() {
		
	}	
	
	public String getTitle() {
		return title;
	}

	public Tag(User user, String title) {
		this.setUser(user);
		this.title = title;
	}
	
	public void increaseCount() {
		count++;
	}
	
	public void decreaseCount() {
		count--;
	}
	
	public int getCount(){
		return count;
	}
}
